// JavaScript Document
function criarObjMSXMLHttp(){
	var versoes = [ "MSXML2.XMLHttp.5.0",
					"MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0",
					"MSXML2.XMLHttp","Microsoft.XMLHttp"
			];
	
			for (var i = 0; i < versoes.length; i++) {
				try {
					var objetoXMLHttp = new ActiveXObject(versoes[i]);
					return objetoXMLHttp;
				} catch (ex) {
					//nada aqui
				}
			}
			return false;
}

function doPost(formName, actionName)
{
        var hiddenControl = document.getElementById('action');
        var theForm = document.getElementById(formName);
        hiddenControl.value = actionName;
        theForm.submit();
}
function editar()
{
	document.getElementById('wsdl').readOnly="";
	document.getElementById('usuario').readOnly="";
	document.getElementById('senha').readOnly="";
	document.getElementById('tlote').readOnly="";
	document.getElementById('laboratorio').readOnly="";
	document.getElementById('url').readOnly="";
	document.getElementById('servidor').readOnly="";
	document.getElementById('bancodedados').readOnly="";
	document.getElementById('usuariobd').readOnly="";
	document.getElementById('senhabd').readOnly="";
	document.getElementById('tlote').readOnly="";
	//document.getElementById('salvar').disabled="";
	//document.getElementById('testar').disabled="disabled";
	//document.getElementById('beditar').disabled="disabled";
}
/*
function testa_conexao() {
var ajax = false;
	if (window.XMLHttpRequest) { // Mozilla, Safari, ...
		ajax = new XMLHttpRequest();
	} else if (window.ActiveXObject) { // IE
		ajax = criarObjMSXMLHttp();
	}
 //se tiver suporte ajax

  if(ajax) {
		 ajax.open("GET","testaConexao.php", true);
		 ajax.onreadystatechange = function() {
          	if(ajax.readyState == 4 ) {
				if (ajax.status == 200) {
					resultadoXML(ajax.responseXML);
				}
			else
		 		viewErroSql("GAL_SERVER","cnsExamesPendentes.php");
		 }
 
     }
     ajax.send(null);
   }
 }
 function resultadoXML(resposta)
{
      var opcoes = obj.getElementsByTagName("resposta");
	  if(opcoes.length > 0) {

         for(var i = 0 ; i < opcoes.length ; i++) 
			 {
				var item = opcoes[i];
				var resposta=item.getElementsByTagName("resposta")[0].firstChild.nodeValue;
				var diluicao=item.getElementsByTagName("diluicao")[0].firstChild.nodeValue;
				var prioridade=item.getElementsByTagName("prioridade")[0].firstChild.nodeValue;
				var material=item.getElementsByTagName("material")[0].firstChild.nodeValue;
				var instrumento=item.getElementsByTagName("instrumento")[0].firstChild.nodeValue;
				var registro=item.getElementsByTagName("registro")[0].firstChild.nodeValue;
			    var origem=item.getElementsByTagName("origem")[0].firstChild.nodeValue;
				var dt_coleta=item.getElementsByTagName("dt_coleta")[0].firstChild.nodeValue;
				var hora_coleta=item.getElementsByTagName("hora_coleta")[0].firstChild.nodeValue;
				var paciente=item.getElementsByTagName("paciente");
				var exames=item.getElementsByTagName("exames");
				var resp=gravar_amostra(amostra,diluicao,prioridade,material,instrumento,registro,origem,dt_coleta,hora_coleta,paciente,exames);
		
    	 }
		 //document.getElementById('carregando').style.display="none";
}

*/